package com.webchat.ugc.controller.mall.im;

import com.webchat.common.bean.APIResponseBean;
import com.webchat.common.bean.APIResponseBeanUtil;
import com.webchat.domain.vo.dto.mall.im.UgcServerMessageDTO;
import com.webchat.rmi.ugc.mall.im.MallChatMessageClient;
import com.webchat.ugc.service.mall.im.MallChatMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class MallChatMessageController implements MallChatMessageClient {


    @Autowired
    private MallChatMessageService mallChatMessageService;

    @Override
    public APIResponseBean<List<UgcServerMessageDTO>> list(String account, String chatAccount,
                                                           Long lastTime, int size, int loadScreenNo) {

        List<UgcServerMessageDTO> messages = mallChatMessageService.list(account, chatAccount, lastTime, size, loadScreenNo);
        return APIResponseBeanUtil.success(messages);
    }
}
